	

***Clean Lucid Datafile


*Change the directory to the location of the replication files on your computer
cd "C:\PCult_Replication"

	
use "Final_Qualtrics.dta", clear

drop if rid==""

duplicates report rid

duplicates drop rid, force

save "Finalb_Qualtrics.dta", replace


use "Final_Lucid.dta"

merge 1:1 rid using  "Finalb_Qualtrics.dta"


gen Q_bach = 0 if q7<5
replace Q_bach = 1 if q7>=5


gen L_bach = 0 if standard_education_v2<6 
replace L_bach = 1 if standard_education_v2>=6


gen speeder300=1 if durationinseconds <300

bysort speeder300: tab gender q9 if _merge==3 & responsestatus=="Complete"

gen gender_off = 1 if gender~=q9 & q9~=3

bysort speeder300: tab gender2 q9 if _merge==3 & responsestatus=="Complete" & gender_off==1



gen ed_off = 1 if L_bach~= Q_bach & _merge==3 & responsestatus=="Complete"


summarize if _merge==3 & speeder300~=1 & gender_off~=1 & ed_off~=1

keep if _merge==3 & speeder300~=1 & gender_off~=1 & ed_off~=1


*Personality coding

*Extraversion (8 items): 1, 6R, 11, 16, 21R, 26, 31R, 36
*Agreeableness (9 items): 2R, 7, 12R, 17, 22, 27R, 32, 37R, 42
*Conscientiousness (9 items): 3, 8R, 13, 18R, 23R, 28, 33, 38, 43R
*Neuroticism (8 items): 4, 9R, 14, 19, 24R, 29, 34R, 39
*Openness (10 items): 5, 10, 15, 20, 25, 30, 35R, 40, 41R, 44


gen Extraversion = (q3_1 + (6-q3_6) + q3_11 + q3_16 + (6-q3_21) + q3_26 + (6-q3_31) + q3_36) / 8

summarize Extraversion

gen Agreeableness = ((6-q3_2) + q3_7 + (6-q3_12) + q3_17 + q3_22 + (6-q3_27) + q3_32 + (6-q3_37) + q3_42) / 9

summarize Agreeablenes

gen Conscientiousness = (q3_3 + (6-q3_8) + q3_13 + (6-q3_18) + (6-q3_23) + q3_28 + q3_33 + q3_38 + (6-q3_43)) / 9

summarize Conscientiousness

gen Neuroticism = (q3_4 + (6-q3_9) + q3_14 + q3_19 + (6-q3_24) + q3_29 + (6-q3_34) + q3_39) / 8

summarize Neuroticism 

gen Openness = (q3_5 + q3_10 + q3_15 + q3_20 + q3_25 + q3_30 + (6-q3_35) + q3_40 + (6-q3_41) + q3_44)/ 10

summarize Openness


***Facets coding

*Assertiveness (Extraversion): 1, 6R, 21R, 26, 31R
*Activity (Extraversion): 11, 16
*Altruism (Agreeableness): 7, 22, 27R, 32
*Compliance (Agreeableness): 2R, 12R, 17
*Order (Conscientiousness): 8R, 18R
*Self-Discipline (Conscientiousness): 13, 23R, 28, 38, 43R
*Anxiety (Neuroticism): 9R, 19, 34R, 39
*Depression (Neuroticism): 4, 29
*Aesthetics (Openness): 30, 41R, 44
*Ideas (Openness): 10, 15, 25, 35R, 40

**excluded
*Extraversion (8 items): 36
*Agreeableness (9 items): 37R, 42
*Conscientiousness (9 items): 3,  33, 38
*Neuroticism (8 items):  14,  24R,  
*Openness (10 items): 5,  20,  40, 


gen Assertive_Ext = (q3_1 + (6-q3_6)  + (6-q3_21) + q3_26 + (6-q3_31)) / 5

gen Activity_Ext = (q3_11 + q3_16 ) / 2

summarize Assertive_Ext Activity_Ext


gen Altruism_Agr = (q3_7 +  q3_22 + (6-q3_27) + q3_32 ) / 4

gen Comply_Agr = ((6-q3_2) +  (6-q3_12) + q3_17 ) / 3

summarize Altruism_Agr Comply_Agr


gen Order_Con = ((6-q3_8) +  (6-q3_18) ) / 2

gen Discipline_Con = (q3_13 + (6-q3_23) + q3_28 +  q3_38 + (6-q3_43)) / 5

summarize Order_Con Discipline_Con

gen Anxiety_Neu = ((6-q3_9) +  q3_19 + (6-q3_34) + q3_39) / 4

gen Depress_Neu = (q3_4 +  q3_29) / 2

summarize Anxiety_Neu Depress_Neu

gen Aesth_Open = ( q3_30 + (6-q3_41) + q3_44)/ 3

gen Ideas_Open = (q3_10 + q3_15 + q3_25  + (6-q3_35) + q3_40 )/ 5


summarize Aesth_Open Ideas_Open


*RWA

***Conservatism
tab q4_1

gen Conservatism = ((6-q4_1)+q4_2+(6-q4_3)+q4_4+q4_5+(6-q4_6))/6

tab Conservatism

**Traditionalism
tab q4_7

gen Traditionalism = ((6-q4_7)+q4_8+q4_9+(6-q4_10)+q4_11+(6-q4_12))/6

tab Traditionalism 


**Authoritarianism

tab q4_13

gen Authoritarianism = ((6-q4_13)+q4_14+(6-q4_15)+q4_16+(6-q4_17)+q4_18)/6

tab Authoritarianism 

 
 **SDO indictors



tab q5_1

gen SDO = (q5_1+q5_2+q5_3+q5_4+q5_5+q5_6+q5_7+q5_8+(6-q5_9)+(6-q5_10)+(6-q5_11)+(6-q5_12)+(6-q5_13)+(6-q5_14)+(6-q5_15)+(6-q5_16))/16

tab SDO

 
 ***TrumpVoter

  gen TrumpVoter = 0
  replace TrumpVoter = 1 if q19==2


***TrumpCult

gen TrumpCult = 0

replace TrumpCult =1 if q19==2 & q25==5 & q26==5 & q27<3 &q28==1 & q37==1 & q45==1


****

*ethnicity

tab q8

gen White_only = 0
replace White_only = 1 if q8=="1"


*gender

tab q9

gen Male = 0
replace Male = 1 if q9==1

gen Female = 0
replace Female = 1 if q9==2

*party

tab q17

gen GOP = 0
replace GOP = 1 if q17==2

gen Dem = 0
replace Dem = 1 if q17==1

*age cats

gen age_24 = 0
replace age_24 = 1 if age1<25
gen age_25_34 = 0
replace age_25_34 = 1 if age1>24 & age1<35
gen age_35_44 = 0
replace age_35_44 = 1 if age1>34 & age1<45
gen age_45_54 = 0
replace age_45_54 = 1 if age1>44 & age1<55
gen age_55_64 = 0
replace age_55_64 = 1 if age1>54 & age1<65
gen age_65 = 0
replace age_65 = 1 if age1>64

*Religion


 gen Religious = 0
 replace Religious = 1 if q10==1
 
 gen Religious_ord = (3-q10)/3
 
 tab Religious Religious_ord
 
 
**rescale B5 SDO RWA 


gen Conservatism1 = ((Conservatism-1)/4)
gen Traditionalism1 = ((Traditionalism-1)/4)
gen Authoritarianism1 = ((Authoritarianism-1)/4)
gen SDO1 = ((SDO-1)/3.375)


*Trump Index

gen TrumpIndex = (TrumpVoter + ((q25-1)/4) +((q26-1)/4) + ((5-q27)/4) + (2-q28) + (2-q37) + (5-q45)/4)/7

summarize TrumpIndex
*hist TrumpIndex
tab TrumpIndex TrumpCult


 gen GOPxMalexWhite = GOP*Male*White_only
 
 gen GOPxMale = GOP*Male
 
 gen MalexWhite = Male*White_only
 
 gen GOPxWhite = GOP*White_only
 
 
 *gen Religious = 0
 *replace Religious = 1 if q10==1

   gen Ed_HSorless = 0
   replace Ed_HSorless = 1 if (q7==1 | q7==2)
   
   tab q7 Ed_HSorless
   
 	gen _45plus = 0
	replace _45plus = 1 if age1>=45 & age1~=.

gen LeftRight1 = (q22-1)/6
gen Right = 0
replace Right = 1 if q22>=6 & q22<=7
gen Conservative = 0
replace Conservative = 1 if Conservatism1>.65  
gen ConservativeTen = 0
replace ConservativeTen = 1 if Conservatism1>.82  

**Trump Cult variations

***approval

gen Trump_JobApproval = 0

replace Trump_JobApproval = 1 if q25==5 & q26==5


****Big Lie

gen Trump_BigLie = 0
replace Trump_BigLie = 1 if q28==1 & q29==2 & q30==1 & q41==1


***Leadership

gen Trump_Leader = 0
replace Trump_Leader = 1 if q19==2 & q37==1 & (q43==1| q43==2) & q44==1

****Trump Status

gen Trump_Status = 0
replace Trump_Status = 1 if (q27==1 | q27==2) & q45==1 & q39==5

***Trump2024
  gen Trump2024 = 0
  replace Trump2024 = 1 if q44==1
  
  tab Trump2024


do "Centering"

do "CreateWeights"

****labels

	label var cConscientiousness1  "Conscientiousness"
	label var cExtraversion1 "Extraversion"
	label var cAgreeableness1 "Agreeableness"
	label var cNeuroticism1 "Neuroticism"
	label var cOpenness1 "Openness"
	label var Conservatism1 "Conservatism"
	label var  Traditionalism1 "Traditionalism"
	label var Authoritarianism1 "Authoritarianism"
	label var SDO1 "SDO"
	label var White_only "White"
	label var Ed_HSorless "High School or Less"
	label var _45plus "45 or Older"
	label var LeftRight1 "Left-Right Ideology"
	label var cIdeas1_Open  "Ideas_Open"
	label var cAesth1_Open "Aesth_Open"
	label var cDepress1_Neu "Depress_Neu" 
	label var cAnxiety1_Neu  "Anxiety_Neu"
	label var cComply1_Agr "Comply_Agr" 
	label var cAltruism1_Agr "Altruism_Agr"
	label var cAssertive1_Ext "Assertive_Ext"
	label var cActivity1_Ext "Activity_Ext"
	label var cOrder1_Con "Order_Con" 
	label var cDiscipline1_Con "Discipline_Con"
	label var C_cThoroughJob  "ThoroughJob"
	label var C_cCareless "Careless "
	label var C_cReliableWorker "ReliableWorker"
	label var C_cDisorganized "Disorganized"
	label var C_cLazy "Lazy"
	label var C_cPersevere "Persevere"
	label var  C_cEfficient "Efficient"
	label var C_cPlansFollowThrough "PlansFollowThrough"
	label var C_cDistracted "Distracted"







